package put.cs.two.to.tsp.models;

public class Point {
    private int x;

    private int y;

    /**
     * Point index taken directly from file thus it is from range 1...n
     */
    private int index;

    public Point(int x, int y) {
        this.x = x;
        this.y = y;
    }

    public int getX() {
        return x;
    }

    public int getY() {
        return y;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    public int getIndex() {
        return index;
    }

    @Override
    public String toString() {
        return String.format("X=%d Y=%d", x, y);
    }

    @Override
    public boolean equals(Object obj) {
        if (!(obj instanceof Point)) {
            return false;
        }
        Point toCompare = (Point) obj;
        return (x == toCompare.x) && (y == toCompare.y);
    }
}
